<template>
  <div>
    <div class="carousel">
      <el-carousel :interval="5000" arrow="always">
        <el-carousel-item v-for="(item, index) in data" :key="index">
          <img
            class="centerimg"
            :src="`${$axios.defaults.baseURL}` + item.url"
            alt=""
          />
        </el-carousel-item>
      </el-carousel>
    </div>
  </div>
</template>

<script>
export default {
  props: ["data"],
};
</script>

<style lang="less" scoped>
.carousel {
  position: relative;
  /deep/ .el-carousel__container {
    width: 100%;
    height: 600px;
  }

  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }

  .el-carousel__item:nth-child(2n + 1) {
    background-color: #d3dce6;
  }
}
</style>